/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistencia;

/**
 *
 * @author Sebastian
 */
public class CriterioSimple implements Criterio{
    private String atributo;
    private String operadorRelacional;
    private Object valor;
    private boolean esString;

    public CriterioSimple(String atributo, String operador, Object valor, boolean esString){
        this.atributo = atributo;
        this.operadorRelacional = operador;
        this.valor = valor;    
        this.esString = esString;
    }
    
    public String getAtributo() {
        return atributo;
    }

    public void setAtributo(String atributo) {
        this.atributo = atributo;
    }

    public String getOperadorRelacional() {
        return operadorRelacional;
    }

    public void setOperadorRelacional(String operador) {
        this.operadorRelacional = operador;
    }

    public Object getValor() {
        return valor;
    }

    public void setValor(Object valor) {
        this.valor = valor;
    }
    
    @Override
    public String convertirAString() {
        if(esString){
            return atributo + " " + operadorRelacional + " '" + valor.toString()+"'";
        }else{
             return atributo + " " + operadorRelacional + " " + valor.toString()+" ";
        }
        
    }
    
}
